<template>
    <div class="good-list">
        <iframe :src="iframeurl" width="375px" height="600"> </iframe>
    </div>
</template>

<script>
import Cookies from 'js-cookie';

export default {
  name: 'Previewdoc',
  data() {
    return {
      timer: undefined,
      iframeurl: undefined,
    };
  },
  watch:{

    $route:{
      handler(now,old){
      let name = this.$store.getters.username || Cookies.get('username')
      name = name.split('@')[0]
      debugger
      let path = 'shop';
      if(location.href.includes('good')){
        path = 'good'
      }
      if(location.href.includes('cook')){
        path = 'cook'
      }
      const urlpath = `${process.env.VUE_APP_H5_BASEURL}/klm/${path}/list?username=${name}`
      this.iframeurl = urlpath
	},
  immediate: true
    }

  },
};
</script>

<style lang="less" scoped>

</style>
